<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="{{ mix('css/app.css') }}">
    <script src="{{ mix('js/app.js') }}"></script>
</head>
<body>
<div id="app">
    <example-component></example-component>
    <button @click="increated" class="layui-btn layui-btn-normal">添加十条</button>
    <div>
        <table class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>编号</th>
                <th>姓名</th>
                <th>年龄</th>
                <th>性别</th>
                <th>手机号</th>
                <th>注册时间</th>
                <th>所在城市</th>
            </tr>
            </thead>
            <tbody>
            <tr v-for="(v,i) in list">
                <td>@{{ i+1 }}</td>
                <td>@{{ v.name }}</td>
                <td>@{{ v.age }}</td>
                <td>@{{ v.sex }}</td>
                <td>@{{ v.phone }}</td>
                <td>@{{ v.addtime }}</td>
                <td>@{{ v.city }}</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
</body>
<script>
    // layer.msg($);
    var app = new Vue({
        el:"#app",
        data:{
            list:[]
        },
        mounted() {
            axios.get("https://www.easy-mock.com/mock/5c0fc7a684df40532d62c034/example/demo2").then( res => this.list = res.data.demo.data);
        },
        methods:{
            increated:function () {
                axios.get("https://www.easy-mock.com/mock/5c0fc7a684df40532d62c034/example/demo2").then( res => this.list = this.list.concat(res.data.demo.data) );
            }
        }
    });
</script>

</html>
